import Pets.Pet;
import Pets.PetCreator;

import java.util.Iterator;
import java.util.List;

public class SimpleIteration {
    public static void main(String[] args) {
        PetCreator petCreator = new PetCreator();
        List<Pet> pets = petCreator.list(12);
        Iterator<Pet> it = pets.iterator();
        while (it.hasNext()) {
            Pet pet = it.next();
            System.out.print(pet.id() + ": " + pet + " ");
        }
        System.out.println();

        for (Pet p : pets) {
            System.out.print(p.id() + ": " + p + " ");
        }
        System.out.println();

        it = pets.iterator();
        for (int i = 0; i < 6; i++) {
            it.next();
            it.remove();
        }
        System.out.println(pets);
    }
}
